<?php
/**
 * Class implementing the
 * <a href="http://www.martinfowler.com/eaaCatalog/tableDataGateway.html">Table Data Gateway pattern</a>
 * to access admin table
 */
class AdminTable extends BaseTable
{
    protected $_name = 'users_admin';

    public function authenticateUser($username, $password)
    {
        $request = $this->select()
                        ->from($this->_name)
                        ->where("login = ?", $username)
                        ->where("pass = ?", md5($password));

        return $this->fetchAll($request);
    }
}